<template>
	<view>
		<baseHead title="企业视频" bg="#ffffff" color="#000000" :text_right="title" :right="false">
		</baseHead>
		<view>
			<view style=" padding: 20rpx; ">
				<!-- <video :src="item" v-for="item in videolist" style="width: 674rpx; height: 385rpx; margin:0rpx 20rpx;"
					:object-fit="cover" :show-center-play-btn="true" loop="true"></video>
				<view style="margin:20rpx;">
					<u-upload accept="video" name="5" :maxCount="2" :previewFullImage="true" v-if="show"
						:disabled="true" :uploadIconColor="uploadIconColor" :deletable="false"></u-upload>
				</view> -->
				<view class="videoContainer" v-for="item in videolist" :key="item">
					<view class="videoClass" @click="gotoVideo(item)">
						<image class="imageClass"
							src="https://cdn.uviewui.com/uview/album/1.jpg">
						</image>
						<image class="top-img" src="/static/static/images/video-file.png">
						</image>
					</view>
				</view>
				
			</view>
		</view>
	</view>
</template>

<script>
	import baseHead from '@/pages/component/baseHead.vue'
	export default {
		data() {
			return {
				URL: this.$config.domain.staticUrl,
				GoodAtVideo: [],
				cover: "",
				model: {
					PhotoPaths: "",
				},
				show: true,
				title: "",
				uploadIconColor: '#f1f2f6'
			}
		},
		components: {
			baseHead
		},
		onLoad(option) {
			console.log(option);
			if (option.CorpId) {
				this.corpid = option.CorpId
			}
		},
		created() {
			this.listdata();
		},

		computed: {
			videolist() {
				return this.GoodAtVideo.map(res => {
					// return this.URL + res
					return res
				})
			}
		},
		methods: {
			//视频跳转
			gotoVideo(item){
				let videoUrl = item
				uni.navigateTo({
					url:'/pages/views/packageA/type-recruit/video/index?item=' + JSON.stringify(videoUrl)
				})
			},
			
			listdata() {
				this.$http.core.tenantgetall(this.corpid).then(res => {
					if (res.Success) {
						console.log(res);
						this.model = res.Result;
						this.GoodAtVideo = JSON.parse(res.Result.VedioPaths);
						console.log(this.GoodAtVideo);
					}
				})
			},
		}
	}
</script>

<style scoped lang="scss">
	/deep/.uni-video-controls {
		margin: 0 !important;
	}

	/deep/ .uni-video-bar {
		padding: 0 !important;
	}
	.videoContainer{
		margin-bottom: 20rpx;
		.videoClass {
			// width: 24%;
			height: 400rpx;
			flex-shrink: 0;
			position: relative;
			border-radius: 15rpx;
		
			.imageClass {
				width: 100%;
				height: 100%;
		
				border-radius: 15rpx;
			}
		
			.top-img {
				width: 60rpx;
				height: 60rpx;
				position: absolute;
				top: 50%;
				left: 50%;
				transform: translate(-50%, -50%);
			}
		}
	}
	
</style>
